/**
 *  ControlFactory
 *
 *  @author : jihuaizhi
 *  @Time   : 2010.03.22 21:08:10 CST
 *  @note   :
 */
package com.basestone.pdlmis.control
{

	public class ControlFactory
	{
		private static var _instance:ControlFactory;

		public static const LOGIN_CONTROL:String="LOGIN_CONTROL";

		public function ControlFactory()
		{
//			if (_instance != null)
//			{
//				throw new Error("This class is a Singleton!");
//			}
			throw new Error("This class is a Singleton!");
		}

//		public static function getInstance():ControlFactory
//		{
//			if (_instance == null)
//			{
//				_instance=new ControlFactory();
//			}
//			return _instance;
//		}

		public static function getControl(controlName:String):ControlBase
		{
			var controlInstance:ControlBase;
			switch (controlName)
			{
				case LOGIN_CONTROL:
					return new LoginControl();
				default:
					return null;
			}
		}
	}
}